package com.fang.singleton;

/**
 * @author fanglingxiao
 * @version 1.0
 * @description TODO
 * @date 2022/4/22 10:46 上午
 **/
public class DoubleCheckSingleton {
    private volatile static DoubleCheckSingleton instance;

    public static DoubleCheckSingleton getInstance() {
        if (instance == null) {
            synchronized (DoubleCheckSingleton.class) {
                if (instance == null) {
                    instance = new DoubleCheckSingleton();
                }
            }
        }
        return instance;
    }
}
